Skip to content

feat(ids): add the auth-user atom builder and the shared I subject atom (P14) - #25

Merged
kamescg merged 3 commits into
update/v1.1.0-alphafrom
codex/p14-ids
Oct 19, 2026
Merged

kamescg merged 3 commits into
update/v1.1.0-alphafrom
codex/p14-ids

Conversation

@jonathanprozzi

Copy link
Copy Markdown
Member

Child PR of the v1.1.0-alpha umbrella (#15). Tracking: ENG-15883.

Current (train)

@0xintuition/ids has no builder for the authenticated-user atom and no shared first-person subject atom.

Need

The reference implementation (intuition-v2 feat/intuition-app @ 1b877506d) derives a deterministic IntuitionAuthUser atom from a hashed user id with the derivation version pinned in the payload, and uses a shared I subject atom whose identity is the exact byte I.

Reconciliation

  • New auth-user-atom.ts (authUserIdHash, createAuthUserAtomData, serializeAuthUserAtomData, authUserAtomDataHex, calculateAuthUserAtomId) and i-atom.ts (I_SUBJECT_ID computed from calculateAtomId at module load and pinned by test), exported from the index and covered by the public-entrypoints test.
  • Imports converted to the package's .js style.
  • Identity impact: additive only. calculateAtomId, calculateTripleId, createPredicateAtomData and every existing constant keep their bytes; the new constants reproduce the reference values exactly.

Held out

  • OAuth atom context URL. The train uses schema.intuition.systems; the reference uses schema.0xintuition.com. Changing it changes OAuth atom bytes and ids, so this PR keeps the train value. Reviewers: please confirm which host is live; that decides whether a follow-up changes it.

Evidence

  • Package tests, typecheck, check and build green; pack dry run green.
  • Independent review: conformance and adversarial passes clean.

Review notes

CI shows the base branch's expired supply-chain exception until the CI-fix child PR merges; this branch is rebased after that.

…atom (P14)

- Add auth-user-atom.ts: deterministic IntuitionAuthUser atom data from a
  hashed user id (authUserIdHash, createAuthUserAtomData,
  serializeAuthUserAtomData, authUserAtomDataHex, calculateAuthUserAtomId)
  with the derivation version pinned in the payload.
- Add i-atom.ts: the shared first-person subject atom whose identity is the
  exact byte `I`; I_SUBJECT_ID is computed from calculateAtomId at module
  load and pinned by test.
- Export the new surface from the package index and cover it in the
  public-entrypoints test.

Ported from the private reference implementation at feat/intuition-app
@ 1b877506d; source imports converted to the package's .js style. The
OAuth atom context URL is deliberately left unchanged pending a ruling.

Identity impact: additive only — calculateAtomId, calculateTripleId,
createPredicateAtomData and every existing constant keep their bytes;
the new constants reproduce the reference values exactly.
…ead of defining it twice (P14)

The I subject atom is defined once, in @0xintuition/ids, and predicates
re-exports it, matching the reference implementation. Bytes and atom id
are unchanged: calculateAtomId('I') is the same on both paths.
@jonathanprozzi

Copy link
Copy Markdown
Member Author

Parity note: added a0b0b84, which makes predicates re-export the I subject atom from @0xintuition/ids instead of defining it a second time. This matches the reference implementation, where the single definition moved to ids and predicates re-exports it. Bytes and atom id are unchanged (calculateAtomId('I') on both paths); predicates typecheck, 30 tests and lint green.

@kamescg
kamescg merged commit 30b6268 into update/v1.1.0-alpha Oct 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants